package cn.com.zhangwoo.microstar.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.widget.ImageView;
import cn.com.microstar.activity.R;
import cn.com.zhangwoo.microstar.utildb.AppManager;


public class Login extends Activity {
	
	ImageView mImageView;
	private Animation Alpha;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		AppManager.getInstance().addActivity(Login.this);
		setContentView(R.layout.activity_login);
		mImageView=(ImageView) findViewById(R.id.activity_logo_image);
		//Alpha = AnimationUtils.loadAnimation(this,R.anim.alpha_action);
		//mImageView.startAnimation(Alpha);
		AlphaAnimation aa = new AlphaAnimation(0.1f,1.0f);
		aa.setDuration(2000);
		mImageView.startAnimation(aa);
		aa.setAnimationListener(new AnimationListener()
		{
			@Override
			public void onAnimationEnd(Animation arg0) {
				new Handler().postDelayed(new Runnable() {
					
					@Override
					public void run() {
						Intent intent=new Intent();
						intent.setClass(getApplicationContext(), MainActivity.class);
						startActivity(intent);
					}
				}, 100);
			}
			@Override
			public void onAnimationRepeat(Animation animation) {}
			@Override
			public void onAnimationStart(Animation animation) {}
			
		});
		
		
		
	}

	
	

}
